<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>王小溟的商城</title>

    <!-- Bootstrap core CSS -->
    <link th:href="@{/assets/css/bootstrap.css}" rel="stylesheet">
    <!--external css-->
    <link  th:href="@{/assets/font-awesome/css/font-awesome.css}" rel="stylesheet" />
    <link rel="stylesheet" type="text/css"  th:href="@{/assets/css/zabuto_calendar.css}">
    <link rel="stylesheet" type="text/css"  th:href="@{/assets/js/gritter/css/jquery.gritter.css}" />
    <link rel="stylesheet" type="text/css"  th:href="@{/assets/lineicons/style.css}">

    <!-- Custom styles for this template -->
    <link  th:href="@{/assets/css/style.css}" rel="stylesheet">
    <link  th:href="@{/assets/css/style-responsive.css}" rel="stylesheet">

    <script  th:src="@{/assets/js/chart-master/Chart.js}"></script>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script  src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

<section id="container" >
    <!-- **********************************************************************************************************************************************************
    TOP BAR CONTENT & NOTIFICATIONS
    *********************************************************************************************************************************************************** -->
    <!-- 网页头部 导入 -->
    <div th:replace="index/header::header"></div>
    <!-- **********************************************************************************************************************************************************
    MAIN SIDEBAR MENU
    *********************************************************************************************************************************************************** -->
    <!--侧边栏-->
    <div th:replace="index/sidebar::sidebar"></div>
    <!-- **********************************************************************************************************************************************************
    MAIN CONTENT
    *********************************************************************************************************************************************************** -->
    <!--main content start-->
    <section id="main-content">
        <section class="wrapper">
            <h3>添加角色</h3>
            <div class="row">
                <div class="form-panel">
                    <form class="form-horizontal style-form"  action="/role/save" method="post">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">角色名称：</label>
                            <div class="col-sm-10">
                                <input name="role_name" type="text" class="form-control" />
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">权限功能：</label>
                            <div class="col-sm-10">
                                <div th:each="p1:${list}" th:if="${p1.pid}==null" style="margin-bottom: 10px;">
                                    <label>
                                        <input name="permissions" type="checkbox" th:value="${p1.permission_id}"/>
                                        <span th:text="${p1.permission_name}"></span>
                                    </label>
                                    <div th:each="p2:${list}" th:if="${p2.pid}==${p1.permission_id}" style="margin:0 20px 0 50px;">
                                        <label>
                                            <input name="permissions" type="checkbox" th:value="${p2.permission_id}"/>
                                            <span th:text="${p2.permission_name}"></span>
                                        </label>
                                        (
                                        <label th:each="p3:${list}" th:if="${p3.pid}==${p2.permission_id}" style="display: inline-block;margin-left: 20px;">
                                            <input name="permissions" type="checkbox" th:value="${p3.permission_id}"/>
                                            <span th:text="${p3.permission_name}"></span>
                                        </label>
                                        )
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label"></label>
                            <div class="col-sm-10">
                                <button type="submit" class="btn btn-primary">添加角色</button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </section>
    </section>

    <!--main content end-->
    <!--尾部-->
    <div th:replace="index/footer::footer"></div>
</section>

<!-- js placed at the end of the document so the pages load faster -->
<script th:src="@{/assets/js/jquery.js}"></script>
<script th:src="@{/assets/js/jquery-1.8.3.min.js}"></script>
<script th:src="@{/assets/js/bootstrap.min.js}"></script>
<script class="include" type="text/javascript" th:src="@{/assets/js/jquery.dcjqaccordion.2.7.js}"></script>
<script th:src="@{/assets/js/jquery.scrollTo.min.js}"></script>
<script th:src="@{/assets/js/jquery.nicescroll.js}" type="text/javascript"></script>
<script th:src="@{/assets/js/jquery.sparkline.js}"></script>


<!--common script for all pages-->
<script th:src="@{/assets/js/common-scripts.js}"></script>

<script type="text/javascript" th:src="@{/assets/js/gritter/js/jquery.gritter.js}"></script>
<script type="text/javascript" th:src="@{/assets/js/gritter-conf.js}"></script>

<!--script for this page-->
<script th:src="@{/assets/js/sparkline-chart.js}"></script>
<script th:src="@{/assets/js/zabuto_calendar.js}"></script>




</body>
</html>